/* Enumeration Color */
var Color = {
Default: '',
Transparent: 'transparent',
Black: '#000',
Red: '#f00',
Green: '#0f0',
Blue: '#00f',
White: '#fff',
Purple: '#f0f'
};

/* Enumeration Border */
var Border = {
None: 0,
Solid: 1,
Dotted: 2,
ThreeD: 3
};

/* Enumeration Grid */
var Grid = {
None: 0,
SinglePixel: 1,
DoublePixel: 2
};

var ColorConvert = function(value) {
	var colorTable = new ColorTable( );
	this.value = colorTable.colorArray[value];
}

ColorConvert.prototype.R = function( ) {
	return ((this.value >> 0x10) & 0xff);
}


ColorConvert.prototype.G = function( ) {
	return ((this.value >> 8) & 0xff);
}

ColorConvert.prototype.B = function( ) {
		return (this.value  & 0xff);
}

ColorConvert.prototype.Rgb = function( ) {
	return 'rgb(' + this.R( ).toString( ) + ', ' + this.G( ).toString( ) + ', ' + this.B( ).toString( ) + ')';
}

/* Enumeration DotNetTypeColors (conforms to the .NET Framework) */
var DotNetTypeColors = {
AliceBlue: 0x1c,
AntiqueWhite: 0x1d,
Aqua: 30,
Aquamarine: 0x1f,
Azure: 0x20,
Beige: 0x21,
Bisque: 0x22,
Black: 0x23,
BlanchedAlmond: 0x24,
Blue: 0x25,
BlueViolet: 0x26,
Brown: 0x27,
BurlyWood: 40,
CadetBlue: 0x29,
Chartreuse: 0x2a,
Chocolate: 0x2b,
Control: 5,
ControlDark: 6,
ControlDarkDark: 7,
ControlLight: 8,
ControlLightLight: 9,
ControlText: 10,
Coral: 0x2c,
CornflowerBlue: 0x2d,
Cornsilk: 0x2e,
Crimson: 0x2f,
Cyan: 0x30,
DarkBlue: 0x31,
DarkCyan: 50,
DarkGoldenrod: 0x33,
DarkGray: 0x34,
DarkGreen: 0x35,
DarkKhaki: 0x36,
DarkMagenta: 0x37,
DarkOliveGreen: 0x38,
DarkOrange: 0x39,
DarkOrchid: 0x3a,
DarkRed: 0x3b,
DarkSalmon: 60,
DarkSeaGreen: 0x3d,
DarkSlateBlue: 0x3e,
DarkSlateGray: 0x3f,
DarkTurquoise: 0x40,
DarkViolet: 0x41,
DeepPink: 0x42,
DeepSkyBlue: 0x43,
Desktop: 11,
DimGray: 0x44,
DodgerBlue: 0x45,
Firebrick: 70,
FloralWhite: 0x47,
ForestGreen: 0x48,
Fuchsia: 0x49,
Gainsboro: 0x4a,
GhostWhite: 0x4b,
Gold: 0x4c,
Goldenrod: 0x4d,
Gray: 0x4e,
GrayText: 12,
Green: 0x4f,
GreenYellow: 80,
Highlight: 13,
HighlightText: 14,
Honeydew: 0x51,
HotPink: 0x52,
HotTrack: 15,
IndianRed: 0x53,
Indigo: 0x54,
Info: 0x13,
InfoText: 20,
Ivory: 0x55,
Khaki: 0x56,
Lavender: 0x57,
LavenderBlush: 0x58,
LawnGreen: 0x59,
LemonChiffon: 90,
LightBlue: 0x5b,
LightCoral: 0x5c,
LightCyan: 0x5d,
LightGoldenrodYellow: 0x5e,
LightGray: 0x5f,
LightGreen: 0x60,
LightPink: 0x61,
LightSalmon: 0x62,
LightSeaGreen: 0x63,
LightSkyBlue: 100,
LightSlateGray: 0x65,
LightSteelBlue: 0x66,
LightYellow: 0x67,
Lime: 0x68,
LimeGreen: 0x69,
Linen: 0x6a,
Magenta: 0x6b,
Maroon: 0x6c,
MediumAquamarine: 0x6d,
MediumBlue: 110,
MediumOrchid: 0x6f,
MediumPurple: 0x70,
MediumSeaGreen: 0x71,
MediumSlateBlue: 0x72,
MediumSpringGreen: 0x73,
MediumTurquoise: 0x74,
MediumVioletRed: 0x75,
MidnightBlue: 0x76,
MintCream: 0x77,
MistyRose: 120,
Moccasin: 0x79,
NavajoWhite: 0x7a,
Navy: 0x7b,
OldLace: 0x7c,
Olive: 0x7d,
OliveDrab: 0x7e,
Orange: 0x7f,
OrangeRed: 0x80,
Orchid: 0x81,
PaleGoldenrod: 130,
PaleGreen: 0x83,
PaleTurquoise: 0x84,
PaleVioletRed: 0x85,
PapayaWhip: 0x86,
PeachPuff: 0x87,
Peru: 0x88,
Pink: 0x89,
Plum: 0x8a,
PowderBlue: 0x8b,
Purple: 140,
Red: 0x8d,
RosyBrown: 0x8e,
RoyalBlue: 0x8f,
SaddleBrown: 0x90,
Salmon: 0x91,
SandyBrown: 0x92,
SeaGreen: 0x93,
SeaShell: 0x94,
Sienna: 0x95,
Silver: 150,
SkyBlue: 0x97,
SlateBlue: 0x98,
SlateGray: 0x99,
Snow: 0x9a,
SpringGreen: 0x9b,
SteelBlue: 0x9c,
Tan: 0x9d,
Teal: 0x9e,
Thistle: 0x9f,
Tomato: 160,
Transparent: 0x1b,
Turquoise: 0xa1,
Violet: 0xa2,
Wheat: 0xa3,
White: 0xa4,
WhiteSmoke: 0xa5,
Yellow: 0xa6,
YellowGreen: 0xa7
};

/* Static Class ColorTable (conforms to the .NET Framework) */
function ColorTable( ) {
	this.colorArray = new Array( );
	this.colorArray[0x1b] = 0xffffff;
	this.colorArray[0x1c] = -984833;
	this.colorArray[0x1d] = -332841;
	this.colorArray[30] = -16711681;
	this.colorArray[0x1f] = -8388652;
	this.colorArray[0x20] = -983041;
	this.colorArray[0x21] = -657956;
	this.colorArray[0x22] = -6972;
	this.colorArray[0x23] = -16777216;
	this.colorArray[0x24] = -5171;
	this.colorArray[0x25] = -16776961;
	this.colorArray[0x26] = -7722014;
	this.colorArray[0x27] = -5952982;
	this.colorArray[40] = -2180985;
	this.colorArray[0x29] = -10510688;
	this.colorArray[0x2a] = -8388864;
	this.colorArray[0x2b] = -2987746;
	this.colorArray[0x2c] = -32944;
	this.colorArray[0x2d] = -10185235;
	this.colorArray[0x2e] = -1828;
	this.colorArray[0x2f] = -2354116;
	this.colorArray[0x30] = -16711681;
	this.colorArray[0x31] = -16777077;
	this.colorArray[50] = -16741493;
	this.colorArray[0x33] = -4684277;
	this.colorArray[0x34] = -5658199;
	this.colorArray[0x35] = -16751616;
	this.colorArray[0x36] = -4343957;
	this.colorArray[0x37] = -7667573;
	this.colorArray[0x38] = -11179217;
	this.colorArray[0x39] = -29696;
	this.colorArray[0x3a] = -6737204;
	this.colorArray[0x3b] = -7667712;
	this.colorArray[60] = -1468806;
	this.colorArray[0x3d] = -7357301;
	this.colorArray[0x3e] = -12042869;
	this.colorArray[0x3f] = -13676721;
	this.colorArray[0x40] = -16724271;
	this.colorArray[0x41] = -7077677;
	this.colorArray[0x42] = -60269;
	this.colorArray[0x43] = -16728065;
	this.colorArray[0x44] = -9868951;
	this.colorArray[0x45] = -14774017;
	this.colorArray[70] = -5103070;
	this.colorArray[0x47] = -1296;
	this.colorArray[0x48] = -14513374;
	this.colorArray[0x49] = -65281;
	this.colorArray[0x4a] = -2302756;
	this.colorArray[0x4b] = -460545;
	this.colorArray[0x4c] = -10496;
	this.colorArray[0x4d] = -2448096;
	this.colorArray[0x4e] = -8355712;
	this.colorArray[0x4f] = -16744448;
	this.colorArray[80] = -5374161;
	this.colorArray[0x51] = -983056;
	this.colorArray[0x52] = -38476;
	this.colorArray[0x53] = -3318692;
	this.colorArray[0x54] = -11861886;
	this.colorArray[0x55] = -16;
	this.colorArray[0x56] = -989556;
	this.colorArray[0x57] = -1644806;
	this.colorArray[0x58] = -3851;
	this.colorArray[0x59] = -8586240;
	this.colorArray[90] = -1331;
	this.colorArray[0x5b] = -5383962;
	this.colorArray[0x5c] = -1015680;
	this.colorArray[0x5d] = -2031617;
	this.colorArray[0x5e] = -329006;
	this.colorArray[0x5f] = -2894893;
	this.colorArray[0x60] = -7278960;
	this.colorArray[0x61] = -18751;
	this.colorArray[0x62] = -24454;
	this.colorArray[0x63] = -14634326;
	this.colorArray[100] = -7876870;
	this.colorArray[0x65] = -8943463;
	this.colorArray[0x66] = -5192482;
	this.colorArray[0x67] = -32;
	this.colorArray[0x68] = -16711936;
	this.colorArray[0x69] = -13447886;
	this.colorArray[0x6a] = -331546;
	this.colorArray[0x6b] = -65281;
	this.colorArray[0x6c] = -8388608;
	this.colorArray[0x6d] = -10039894;
	this.colorArray[110] = -16777011;
	this.colorArray[0x6f] = -4565549;
	this.colorArray[0x70] = -7114533;
	this.colorArray[0x71] = -12799119;
	this.colorArray[0x72] = -8689426;
	this.colorArray[0x73] = -16713062;
	this.colorArray[0x74] = -12004916;
	this.colorArray[0x75] = -3730043;
	this.colorArray[0x76] = -15132304;
	this.colorArray[0x77] = -655366;
	this.colorArray[120] = -6943;
	this.colorArray[0x79] = -6987;
	this.colorArray[0x7a] = -8531;
	this.colorArray[0x7b] = -16777088;
	this.colorArray[0x7c] = -133658;
	this.colorArray[0x7d] = -8355840;
	this.colorArray[0x7e] = -9728477;
	this.colorArray[0x7f] = -23296;
	this.colorArray[0x80] = -47872;
	this.colorArray[0x81] = -2461482;
	this.colorArray[130] = -1120086;
	this.colorArray[0x83] = -6751336;
	this.colorArray[0x84] = -5247250;
	this.colorArray[0x85] = -2396013;
	this.colorArray[0x86] = -4139;
	this.colorArray[0x87] = -9543;
	this.colorArray[0x88] = -3308225;
	this.colorArray[0x89] = -16181;
	this.colorArray[0x8a] = -2252579;
	this.colorArray[0x8b] = -5185306;
	this.colorArray[140] = -8388480;
	this.colorArray[0x8d] = -65536;
	this.colorArray[0x8e] = -4419697;
	this.colorArray[0x8f] = -12490271;
	this.colorArray[0x90] = -7650029;
	this.colorArray[0x91] = -360334;
	this.colorArray[0x92] = -744352;
	this.colorArray[0x93] = -13726889;
	this.colorArray[0x94] = -2578;
	this.colorArray[0x95] = -6270419;
	this.colorArray[150] = -4144960;
	this.colorArray[0x97] = -7876885;
	this.colorArray[0x98] = -9807155;
	this.colorArray[0x99] = -9404272;
	this.colorArray[0x9a] = -1286;
	this.colorArray[0x9b] = -16711809;
	this.colorArray[0x9c] = -12156236;
	this.colorArray[0x9d] = -2968436;
	this.colorArray[0x9e] = -16744320;
	this.colorArray[0x9f] = -2572328;
	this.colorArray[160] = -40121;
	this.colorArray[0xa1] = -12525360;
	this.colorArray[0xa2] = -1146130;
	this.colorArray[0xa3] = -663885;
	this.colorArray[0xa4] = -1;
	this.colorArray[0xa5] = -657931;
	this.colorArray[0xa6] = -256;
	this.colorArray[0xa7] = -6632142;
}